package com.xbongbong.paas.log.entity;

import com.xbongbong.paas.toolbox.util.DateUtil;
import lombok.Data;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

@Data
@Document(collection = "outLink_query_log")
public class OutLinkQueryLogEntity implements Serializable {

    private static final long serialVersionUID = -1908544046021341687L;

    private static final Logger LOG = LoggerFactory.getLogger(OutLinkQueryLogEntity.class);

    /**
     * 主键ID
     */
    @Id
    private String id;

    /**
     * 公司ID
     */
    private String corpid;

    /**
     * 操作人员工ID
     */
//    private String userId;

    /**
     * 操作人员工姓名
     */
//    private String userName;

    /**
     * 根据不同平台操作分别取以下值：android, ios, web, dingtalk, all
     */
    private String platform;

    /**
     * 浏览器信息，记录浏览器内核相关信息
     */
    private String browserInfo;

    /**
     * 操作者IP，api端可以不用处理该参数，设为空字符串
     */
    private String ip;

    /**
     * 备注信息
     */
    private String memo;

    /**
     * 操作时间
     */
    private Integer addTime;

    /**
     * 查询条件
     */
    private String conditions;

    /**
     * 查询链接
     */
    private String url;

    /**
     * 所属模块
     */
    private String module;

    public OutLinkQueryLogEntity(String corpid,  String platform, String browserInfo, String ip,String conditions, String url, String module) {
        this.corpid = corpid;
//        this.userId = userId;
//        this.userName = userName;
        this.platform = platform;
        this.browserInfo = browserInfo;
        this.ip = ip;
        // 查询时间为当前时间
        this.addTime = DateUtil.getInt();
        this.conditions = conditions;
        this.url = url;
        this.module = module;
    }
}
